added debugging logs.