Only set namespace context if set properly in order to avoid nullpointer