another attempt at getting ccall to work inside try catch