Implement logic to prevent division by zero error.