functionality to create newposts