Added console.log to show in which order stuff gets called