Adding queue function.