modify to compatable with 2.1-stable