added more elegant support for relative file paths