added some error printing