Fix timestamp check