fxed minor bugs