Thank you very much for your comment, unfortunately this is not due to the programming, but GB-Studio as a platform does not work well many times. I can't fix this. :( I'm glad you wrote it, thanks!
Oops!I see.There might be a work around...