fixes pingpong effect