fixed keep_input_directory type issue