add error handling
fix partition bug