Fixes infinite loop of doom