ios 8 compatibility. This and previous fix #1