erlog memory refactoring
fix closing cursor issue