adjusted definition to only work for destroy action