castPtr() is added