conver some error , and complete block main.