adding some console.logs to debug