fixed but now memory leak