Updated a variable test to avoid warning notices if variable is empty