fixed deleting bug