Prevent multiple direction changes