finally fixed one bug with segfaults