fix detection of changing location, thanks to @johnlo1992, fixes #6