Does this check should not be done as the enter of the function instead?