Fixed bug where location was set wrongly.