HTTP Requests are designed to work asynchronously. Implement synchronous (Ajax) requests to handle it.