some error and logging updates