Fixed direction change bug