fixed leaks and stuff :-)