Fixing async bug in compile()