Changed Pi::register('user') to Pi::service('user')->getUser()