fixes removing shared preferences

fixes #949 

See ^ issue for problem description.