added some error stuff