Fixed queue function according to new schema