fix log and constructor