fixed error on router once function