modified code for getUserData