corrected the bugs