adds flag check for sub