delete not working as expected