After running the code in Visual Studio Code, & even asking Github Co-Pilot to confirm; I have concluded that your Lua program is working just as intended, I have went through the following choices in an attempt to trigger the bug, but it has worked perfectly for me, I believe that this might be an issue with your Text Editor / IDE of your choice, but great job for a first time project, & continue doing what you are doing, for any further questions; just reply to this comment.