add lock into memory system