file printing merged with all types of printing but has bug in last character