solved some minor bugs