handle file URLs properly