fied some minor bugs