fixed bug i made last time