can you try 
```php
$params = Param::params();
$params["user_id"] = User::getId($_SESSION['username']);
$task->set($params);
```

and remove L14 - L20 po :bow: