fix some bugs and update copyright