mem trial and error fix