Fixed an issue when currentScope was undefined