correct the if-else mistake