Fixed nil bug when creating post