iOS8 support
Fixed deprecated methods