fixed a problem with delete()