Fix bug in delete action