fix bug of models and remove test code