fix for xk-2053
Integrate Tassapol's changes into hdp-select