add error handle support