no more mainfunc,add error types