Better handling of error situation