adding more memory validation