Use static variable instead of global