initialize htdv device variables outside of if statements to prevent scope issue