open done with fixes on memory management