fixed faulty looping crashing the server