moved object creation to bottom