handling updating count