Changed some commits with apply for shared preferences