fixed branch checking