adding exists() function