fixed the scoped variable