add onStop method to save written data on memopad application