improve error handling
add reset script