added inventory related logic