added features by fenghua