add some casting to avoid mistakes from confusion