store: fix the bug caused by random iteration order over map

fixes #38