fixed different bugs