whoops forgot to initialize map outside of if statement