fix bug when adding post