alex posn
beefed up error handling