fixed bug with object creation