some changes and bugs