delete now works correctly and working on edit function