reimplement cat by queue