fixed an if-statement