check var existence before use