Stop sonata from running after it's reached the last day
Fixing the interval and removing some unused code