added comment type and connection type checking for adding comments and connections