fix constructor and test