fixed double final new line bug