adjusted filepath handling