add while to wait async javascript ajax calling