remove extra check from end of string and update test