Time restriction not working as planned. Added logging to debug.