corrected memory check from 500 to 512