fixes #2166 - error when clearing location