function to check if inventory exists in stash