Layout crash bugfix