fix #3, fix issue with data lose