bug fix in memory data layer