Added weakSelf for the code inside block