updated to use ~ and environment variable instead of absolute path