bug in else statement