Refactored stack path to use File.join instead of concatenation.