handle file inputs