running script in new thread