mainly bug fixing