fixed seg fault with gdb, memory leakage for now