updated modify to work with phone gap