checking before printing was added