rawpath option and better error handling