Fixed issue with scope