Use global variable instead of passing local one