Trying to sort index not found error on phonegap build