added some error log statements