fixed some redirecting issues so that  device's location is passed along