need to chedk w valgrind