Added a console.log to try and trace the code