Removed repeated line in check_pattern