updated to take url as argument