Better variable test to prevent notice in the logs