fix for if tghe main is deleted