add some additional error logic