Added security measures for posts and comments