fixed unsafe code