fix problem with error in callback