freed some stuff. gots a segfault