fixed issue with scope