added function for counter animation