Don't take substring twice