Add condition in for cycle