moved run into anonymous function