added check for weakSelf being nil before trying to assign strongSelf to it