add log option and modify decalration