Added string ending checks