Added error functionality for post creation