Fix bug, test variable instead of function