better location filtering and add deselect by clicking on active layer