Add boolean flag to handle concurrent ajax requests