Modified code in getUserData.