changed detection position from void_p to ulong