fixed reference error
Fixed missing endif;