Add support for older os that doesn't support weak references