Use `exists()` instead of `count()` to check for existence.

Also, a more readable way of splitting this up would be to assign the value to a variable and use it in the conditional. I generally try to avoid multi-line conditionals of possible.