Adding proper logging