private void checkTask(Calendar cal) {
		Task[] tasks = DBHandler.getAllTasks();
		boolean wasChange;

		for (Task task : tasks) {

			wasChange = false;

			if (!task.isWas_handled()) {

				if (!(task.isTasKFirstSent())) {
					sendTaskToRecipient(task);
					task.setFirstsent(true);
					wasChange = true;
				}

				if (task.isTaskDone()) {
					sendTaskCompleted(task);
					task.setWas_handled(true);
					wasChange = true;
					System.out.println(task.isWas_handled());

				} else if (cal.getTime().after(task.getDue_date())) {
					 
					sendTaskTimeIsDue(task);
					task.setWas_handled(true);
					wasChange = true;
				}
			}
			if (wasChange) {
				DBHandler.addTask(task);
			}
		}
	}