fix memory cacthe bug