add count functionality to ajax