updated tr-selected directive. extracted query id string key.