check for existance of groups before running SQL, to remove failed connect to mysql error