fix HDP code