cleanup
make more robust