fixed the standing/flipping bug