updating casting in utilities.h