make sure we use the proper cast