improves location handling