fix hash generator