modified deleterow method