Fix location crash