check for branch coverage and fix missed branch