fix empty path case