add elseif clause in generator