checkForExisting functionality added