some changes and fix