fixed #14 by improving location handler