fixed datalayer function to return user frequency as well