added error checking for comments