fix delete operation. need to implement permission checking for delete.