refix htc bug and fix dependences