Add error handling for bad paths