Prevent view crashes