fixed bug with delete not working