remove weird ending lines