this fixes some crashes in mono