added conditionals for all addEventListener functions