improved dropdown menu handling