fix bug: wrong arguments in if-else statement