catch error when creating a new page