tweak to ternary isset to handle failure