fixed page flipping bug