add proper logging