tmp fix for pointer downcasting