fixed somewhere leak memory bugs