updated console.log statement in ternary statement