almost fixed bug with infinite building