Improved script to be able to update the scene if executed again