Fixed lock bug introduced by async