plugged memory leak. fixed read performance bug