Fixing helper method for file path validation