Fixed error function for location and extended timeout