Fix if statement ending