finish inport function