Not checking if statement is closed