Fixed wandering bug