fixed the bugs!