fixed a bug with wrong comments

this will prevent invalid comments being generated