updated to use ~ and environment variable instead of absolute file path