add logic for file/url checking