readding conditional to avoid loading files twice