improved the error message a bit for invalid paths