properly handle nested comments