fixed minor bug in delete