make code more resistant to exceptions