fix unclosed if