Finally got the create() function working