better input handling for file paths