some changes and fixes