Modification for error handling.