debugged one error for memory