added presave hook for update post
added exception handling in update handler