added some error handles