fixed the set location crash