fixed bug in new contstructor