MainFunction finished
bug fix