Fixed bug in querying url