added method for setting data directly