Function setProfile works properly from test app