moving correction of the namespace parameter to _cleanup()