added logic to submit comments and posts