added more condition for file convert
fixed a minor error