fix beforeDelete function error