fixed the create() function