mainfile bug fixed