added another constructor
fixed a memory leak