fixed bug in group by id sql error and edited some features in addActivity