fixed couple syntax errors
scope: use our instead of my inside closures
use // 'or_else_its_empty' for var assignment to avoid undefined vars