Added additional checks
Added functionality to pass url