fixed Some issues related to inventory