added memory checker