Fixed bug in updatePost