fixed the problem with the else left out from the {}