added states & using url.toString()