- added type checking and conversion to cef return value