minor changes and bug fixing