fix errors when blockhash = null