test variable before using it