Updated to use path.resolve