fized some minor bugs