minor code cleanup
fixed condition on hash reset