correctly checkout branches