Fix window scope in map controller