Better handling of the errors