Added try/catch to avoid VS crashes