some changes to fix some problems