ac problem

2000 ford ranger 4cyl 2.5 liter

my ac keeps defaulting to defrost when I accelerate and back to vents when I slow down. Any idea what my problem could be?