Fixed issue with if/else statement