Added source file opening, IF stat doesn't work