updates for memory safety