fix location bug