The script now logs correctly!