FIX change direction function