Fixing getBlock() function