add sendfile to main function