check variable before using