minor bugs fixing