fixed a bug with xp