clean file and fix bug