modify async javascript