Fixed ternary if statement