added auto lock for everything except for main