Deleting database references