fix coding style. use standard `if`