added separate branch checking to see overwriting