What could generally cause this function to crash?