modified to work with local paths