add check for print flag