Fixed memory issue