fixed flipping with close button