added exceptions for C#