fix bug and improve.