bug fixing & minor changes