adjust struct and add log output