change rtrim function