Declaring file resource instead of concat with a if statement so it's only declared once