fixing some minor bugs