handle errors on create