add framework main and forkIO for fraework thread