try and except added to index