finally found the bugs