fixed it copying too much memory