Fix access error caused from close method