fixing bug of -p mode at Mac environment