avoiding a NPE. Found on support tickets