fixed BS bugs