Instead of casting types, rather assure that you are using similar types.