McCrory takes oath of office