set page to 1 when invalid page number