Added optional quantity to the spawn command