bug fixing mainly