fix different bugs