fixes for block detection - not complete yet