reflect: added memory checking