Prevent race condition in Router