Updated window namespace to check before creating namespace