added exception check for existing records