Change branch checking logic from timeout to checking in cycle