catch memory error for QSDR