Race condition ajax for recording activity. Fixed