changed to logging