initialize and protect against null pointer