time detection working