Fix. Added scope to function