added more debug console.logs