check branch then update