updated models with extra error checking