fixed object removing code