Use local variable text instead of global