updating call to error handling to use C++ style static_cast instead of C style cast