more robust queue handling