fix jumping and boundaries