public function afterCreate()
    {
        //create company
        $company = new Companies();
        $company->name = $this->defaultCompanyName;
        $company->users_id = $this->getId();
        if (!$company->save()) {
            throw new Exception(current($company->getMessages()));
        }

        $this->default_company = $company->getId();

        if (!$this->update()) {
            throw new Exception(current($this->getMessages()));
        }
    }