Fixed add and update post and page errors