trying to avoid printing null character