add methos and fix bug