Modify position to itemId, but with some bugs