use a better way toi stop mnesia and add logs