fixed get all branches by making it a method