Bingo! :)
I had already thought about inserting a short delay but I first wanted to know if I am using the close() method correctly.
Thank you!