fixed bug in delete and add