check for statement closed