Possibly better hack to prevent crashes