changed to mnesia as db