add format detection for input/output