a reimplemented secrete function in MacOS