 CREATE TRIGGER before_insert_task BEFORE INSERT ON task
 FOR EACH ROW
 BEGIN
-  DECLARE defaultTaskLimit DECIMAL(7,2);
+  DECLARE defTaskLimit DECIMAL(7,2);
   call check_edit_task(NEW.projectID);
 
   SET NEW.creatorID = personID();

BEGIN
  DECLARE validDate DATE;
  DECLARE pID INTEGER;
  DECLARE rate BIGINT(20);
  DECLARE rateUnitID INTEGER;
  call check_edit_timeSheet(OLD.timeSheetID);

  SET NEW.timeSheetItemModifiedUser = personID();


  SET NEW.personID = personID();
  SELECT projectID INTO pID FROM timeSheet WHERE timeSheet.timeSheetID = NEW.timeSheetID;
  SELECT rate,rateUnitID INTO r,rUnitID FROM projectPerson WHERE projectID = pID AND personID = personID();

  -- if rate is neq project-person rate AND they're don't have perm halt with error about rate
  IF (neq(NEW.rate,r) AND NOT can_edit_rate(personID(),pID)) THEN
    call alloc_error("Time sheet's rate is not editable.");
  END IF;

  IF (NEW.rate IS NULL AND r) THEN
    SET NEW.rate = r;
    SET NEW.timeSheetItemDurationUnitID = rUnitID;
  END IF;

  IF (NEW.taskID) THEN
