improved method for counting the data. Added method to catch the
exception properly
New exception class to catch data not found exception
Using the catch exception method