Working, but still need to debug the expired followed by valid appointment scenario