add log statments to help troublehsoot.