still working on delete function...no success
fixed logic for delete