Fixed a rare crash