remove extra endif