add flex support