add block

add block and repair some bugs