fixed missing endif