adding logging for debugging