fixing yet another scoping issue