[wip]modify error handling