handling invalid URLs and show warning flash