Fix page sorting