fix lazy memory issue