Add sanity check for next visit calculation