teiiddes-2153

Added null check and added logic for multiple namespaces in the case of Message mode.