better error handling with --serve