added some logic to create