minor bugs fixed