fix printing related issues