Maybe you clicked X instead of Z, thus leaving the store? I should honestly improve this part a bit.
Pretty sure I lost that gold^^'