fix nasty bug with async behavior

the timestamp of groupnames was identical since the insert
was inside an async function, which causes the time to be the same
at the moment of insertion.

the solution was simple - wrap the async code with immediately called
anonymous function and pass the timestamp.