Fix missing DIR variable

Just reversed line 18 and 19 to fix the missing $DIR variable because $DIR was being assigned after it was being used.