fixed core data model relationship delete to nullify
added a check for object in cache