fixed using of defer inside go.