modify create update logic