Added logging all around.