Replaced ternary operator with standard if.