fix scope problem, and dot printing issue