segfaults fixed, forgot to reset everything