fix bug in hdate