fix #2, resolve #4, close #5