Reinstating global val and fixing actual issue