add storage functions for mag
fix test
fix test
Merge branch 'develop'