fix constructor with optional path