That's the expected behavior. Why? Well, you set the days between checks to 1 and the grace period to 1, and 2 days have passed since your app was able to reverify with the servers. Thus it's not genuine anymore. It'll still be activated, but by using (1, 1 ...) as parameters you're saying you want the customer to check every single day and you only want to give them 1 day grace period.
Instead of showing "XXX has been unable to check the validity of your license ...", show a dialog that give the user either the ability to re-check immediately or exit your app.
Short answer: modify what happens in the if statement & change the parameters of IsGenuine to something like (30, 14)
Does that make sense?