Fix deprecated issues with ios >= 6