added better date scoping