fixed a bug in head_detect_dpm