fixed some minor bugs