Fixed unclosed if statement