fixed issue with use of ternary if operator