null check for get profile method