Made the changes suggested by Tim
1)  an optional method  must be checked.
2) not using unsafe_unretained, and using weak.
3) have to call synchronize on NSUserDefaults