Fixed a bug cause by viewDidLayoutSubviews being called multiple times.