Removed unsafe code and removed unused return value