version 0.2, simplified error handling