add checks for flags