add flags for sub
add flags for sub