fixed empty check with improper variable set.