bug fix and model test