added error handling

Needs to be properly translated