improved some minor bugs