Added some new logic to handle new versions of android.
Also included a check to make sure that nothing will be added that already exists.