merged main and lock