Fix a logical bug when setting async/sync mode.
Merge pull request #534 from orientalsensation/ResponseHandler

Fix a logical bug when setting async/sync mode.