Added handle_alert() context manager