fix #14, add code to refresh memory before retring command.