added guards on term and logger