move deselect event triggering to one central place