exists has a garbage value, so evaluating it in an if statement can cause weird behaviour.
Merge pull request #1 from HarveyHunt/feature/fix_garbage_value

Fixed a logic error