Fixed the location bug