change nonatomic to atomic where possible