fixed logging I think