Fixing endif issue