fix partition and add test