Only run the delete_keys function if there are actually keys to delete