moved selfcheck out of main file