fix hash in constructor