cast pointers to make compiler happy