Problems with creating objects