fallback to filename when filepath is nil