Modfied from create to avoid data loss in db