preventing router example from crashing browser