Corrected bug on inv creation