fixed error when used sync and dir with routes