added try catch to index action