add reproduce bug code and fixed the code