add reference
add a para to control if run background only and fix the encode problem