fix each
add block
add some error messages
add tests