made file_path global
removed global file_type