Fix user id in history sort