update deprecated method since ios6