fixed printing bugs