fix some  bugs.