fix bug with respect to delete