Reverted 1.0.5 code as it introduced a bug. Version updated instead of reverted to support those who use CocoaPods