Fixed page direction bug