fix bug when locaation is not define