refactored submit file