add check for repeated output