env probe script fixed to handle cases where you delete the last or first assigned object