added url capability and debugged