formatted registerLocationListener method