fix bug; support OSX