bugfix and support Mac&Linux platform