fixed issue where else statement were not inside the correct context