added create comment function and added validation in thread.php