cleanup on error closing
Merge pull request #5 from mapmyfitness/CORE-556

CORE-556