FIXBUG: s in finally is undefined if exception happens

and remove an uneccesary nested try