changes and fix bugs