small fixes and add log