added branch condition checking