Fixed crazy bug

I dont know why the fix in the commit fixes it, but it does. Very bizzar
bug