With global variable check