bug fix--scope issue