Refine the code and this is a stable version now.