solved scope problem