Tried to fix the XPHandler. Not quite fixed.