fix generating hash