fix statement handling (closing)