fix returning of handles instead of ids