better filepath handling