Altcoin creation from bitcoin ReadBlockFromDisk: Errors in block header at CBlockDiskPos
instead of using merkel hash from the code run i used a genesis block generator to generate the hash,nounce. it took an hour to get the values using this code:

https://github.com/Gnaf/GenesisBlockZero

then i used the values from this and it worked.