Add condition on end of string