Added error checking for when no branch supplied