fixed bug from 548d0ca817 and removed unnecessary "haDoc" function