Add cast to function pointer to remove warning