implemented shared prefernces