do typecasts to avoid compiler warnings