add error logic on callback