Should fix this error:
engine.lua:45: attempt to index global 'inv' (a nil value)