Improved exists() method