working selection listener