checking filesystem before main in rebuild