fixed the bug causing store not to work properly
added documentation