added stopUpdating location selector and cleanedup code