Stack dictionary not being filled