memory management fix
merge fix