add function for log option