clean up before branch