Also now when i fill in the correct details and when the case is saved the count doesn't increase. Any idea why? I have written the same script which you have suggested and it stopped increasing the count when the case isn't saved and gave errors, but when i enter the right fields and case is saved and i updated the count still doesn't increase.