add logging for debugging and info