Bug fix for isExpired