improve handling of dropdown menu