fix a bug when create a new post