all the function have be done

fix bug