fixing url strings, adding debug mode