fix the wrong logic of if-else condition