Fixed a missing endif