Actually, since mode is a local variable that you're setting here, maybe you should just move all the initPick() code here instead and get rid of that function.