Update branch history and create isValidBranch