Ensure variable is correctly initialised before using