Fixing async blocks at function level