fixed create groups function
fixed create groups function again