fixed clock var scoping issue