avoid the crash in some conditions