-fixed dict problem
-still some leaks