Seperated the filerunning form the fomautomator and made some changes