memory leak is slightly better but still not good enough