enabled cleanup code, things seem to be working