fix dumb cast bug (need to remove casts)