work on newpost function