finally works locally and recursively