add defer Close()
remove debug