forgot some error handling
issue #6