replaced type cast with macro to do the same thing