using event to wait for response end; and add format config