fix for open 'if' scope