fix std resource scope bug