Add comments and exit condition for error listener