adding upsert functionality
adding upsert functionality