memory leak problem fixed