some minor changes and fix