adding file counter method