Changes for some memory issues; wtf up with close? check later