fix issue found on iOS8, thanks for http://stackoverflow.com/a/24063578/4073287