diff --git a/app/.meteor/packages b/app/.meteor/packages
index d1adba9..b12a08e 100644
--- a/app/.meteor/packages
+++ b/app/.meteor/packages
@@ -1,68 +1,69 @@
 # Meteor packages used by this project, one per line.
 # Check this file (and the other files in this directory) into your repository.
 #
 # 'meteor add' and 'meteor remove' will edit this file for you,
 # but you can also edit it by hand.
 
 coffeescript
 accounts-password
 alanning:roles
 aldeed:autoform
 aldeed:collection2
 drskullster:bootstrap
 jabbslad:basic-auth
 less
 meteorhacks:aggregate
 iron:router
 ian:accounts-ui-bootstrap-3
 sacha:spin
 matb33:collection-hooks
 fortawesome:fontawesome
 mistereo:identicon
 momentjs:moment
 aslagle:reactive-table
 mizzao:user-status
 aldeed:autoform-bs-datetimepicker
 aldeed:autoform-bs-datepicker
 rajit:bootstrap3-datepicker
 tsega:bootstrap3-datetimepicker@=3.1.3_3
 mrt:jquery-ui-sortable
 meteorhacks:npm
 
 
 d3js:d3
 workman:x-editable-reactive-template
 cfs:standard-packages
 cfs:filesystem
 frozeman:template-var
 peppelg:bootstrap-3-modal
 yogiben:autoform-file
 reactive-var
 mizzao:timesync
 reywood:publish-composite
 q42:autoform-markdown
 aldeed:template-extension
 
 
 standard-minifiers
 meteor-base
 mobile-experience
 mongo
 blaze-html-templates
 session
 jquery
 tracker
 logging
 reload
 random
 ejson
 spacebars
 check
 
 
 npm-container
 joshowens:accounts-entry-1.2
 chriswessels:hammer
 ajduke:bootstrap-tagsinput
 sergeyt:typeahead
 jesperwe:bootstrap-select
+percolate:migrations
diff --git a/app/.meteor/versions b/app/.meteor/versions
index b23cfea..707b9d6 100644
--- a/app/.meteor/versions
+++ b/app/.meteor/versions
@@ -1,152 +1,153 @@
 accounts-base@1.2.2
 accounts-password@1.1.4
 ajduke:bootstrap-tagsinput@0.7.1
 alanning:roles@1.2.14
 aldeed:autoform@5.7.1
 aldeed:autoform-bs-datepicker@1.1.1
 aldeed:autoform-bs-datetimepicker@1.0.6
 aldeed:collection2@2.5.0
 aldeed:simple-schema@1.4.0
 aldeed:template-extension@3.4.3
 anti:i18n@0.4.3
 aslagle:reactive-table@0.8.20
 autoupdate@1.2.4
 babel-compiler@5.8.24_1
 babel-runtime@0.1.4
 base64@1.0.4
 binary-heap@1.0.4
 blaze@2.1.3
 blaze-html-templates@1.0.1
 blaze-tools@1.0.4
 boilerplate-generator@1.0.4
 caching-compiler@1.0.0
 caching-html-compiler@1.0.2
 callback-hook@1.0.4
 cfs:access-point@0.1.49
 cfs:base-package@0.0.30
 cfs:collection@0.5.5
 cfs:collection-filters@0.2.4
 cfs:data-man@0.0.6
 cfs:file@0.1.17
 cfs:filesystem@0.1.2
 cfs:http-methods@0.0.30
 cfs:http-publish@0.0.13
 cfs:power-queue@0.9.11
 cfs:reactive-list@0.0.9
 cfs:reactive-property@0.0.4
 cfs:standard-packages@0.5.9
 cfs:storage-adapter@0.2.3
 cfs:tempstore@0.1.5
 cfs:ui@0.1.3
 cfs:upload-http@0.0.20
 cfs:worker@0.1.4
 check@1.1.0
 chriswessels:hammer@4.0.2
 coffeescript@1.0.11
 d3js:d3@3.5.8
 ddp@1.2.2
 ddp-client@1.2.1
 ddp-common@1.2.2
 ddp-rate-limiter@1.0.0
 ddp-server@1.2.2
 deps@1.0.9
 diff-sequence@1.0.1
 drskullster:bootstrap@3.3.1_1
 ecmascript@0.1.6
 ecmascript-runtime@0.2.6
 ejson@1.0.7
 email@1.0.8
 fastclick@1.0.7
 fortawesome:fontawesome@4.5.0
 frozeman:template-var@1.2.2
 geojson-utils@1.0.4
 handlebars@1.0.4
 hot-code-push@1.0.0
 html-tools@1.0.5
 htmljs@1.0.5
 http@1.1.1
 ian:accounts-ui-bootstrap-3@1.2.84
 id-map@1.0.4
 iron:controller@1.0.12
 iron:core@1.0.11
 iron:dynamic-template@1.0.12
 iron:layout@1.0.12
 iron:location@1.0.11
 iron:middleware-stack@1.0.11
 iron:router@1.0.12
 iron:url@1.0.11
 jabbslad:basic-auth@0.2.2
 jesperwe:bootstrap-select@1.7.4_4
 joshowens:accounts-entry-1.2@1.0.3
 joshowens:simple-form@0.2.1
 jquery@1.11.4
 launch-screen@1.0.4
 less@2.5.1
 livedata@1.0.15
 localstorage@1.0.5
 logging@1.0.8
 matb33:collection-hooks@0.8.1
 mdg:validation-error@0.1.0
 meteor@1.1.10
 meteor-base@1.0.1
 meteorhacks:aggregate@1.3.0
 meteorhacks:async@1.0.0
 meteorhacks:collection-utils@1.2.0
 meteorhacks:npm@1.5.0
 minifiers@1.1.7
 minimongo@1.0.10
 mistereo:identicon@1.0.0
 mizzao:timesync@0.3.4
 mizzao:user-status@0.6.6
 mobile-experience@1.0.1
 mobile-status-bar@1.0.6
 momentjs:moment@2.10.6
 mongo@1.1.3
 mongo-id@1.0.1
 mongo-livedata@1.0.9
 mpowaga:jquery-fileupload@9.11.2
 mpowaga:jquery-ui-widget@1.11.4
 mrt:jquery-ui-sortable@1.10.3
 mrt:underscore-string-latest@2.3.3
 nemo64:bootstrap-data@3.3.5
 npm-bcrypt@0.7.8_2
 npm-container@1.2.0
 npm-mongo@1.4.39_1
 observe-sequence@1.0.7
 ordered-dict@1.0.4
 peppelg:bootstrap-3-modal@1.0.4
 perak:markdown@1.0.5
+percolate:migrations@0.9.8
 promise@0.5.1
 q42:autoform-markdown@1.0.0
 raix:eventemitter@0.1.3
 rajit:bootstrap3-datepicker@1.5.0
 random@1.0.5
 rate-limit@1.0.0
 reactive-dict@1.1.3
 reactive-var@1.0.6
 reload@1.1.4
 retry@1.0.4
 reywood:publish-composite@1.4.2
 routepolicy@1.0.6
 sacha:spin@2.3.1
 sergeyt:typeahead@0.11.1_6
 service-configuration@1.0.5
 session@1.1.1
 sha@1.0.4
 softwarerero:accounts-t9n@1.1.6
 spacebars@1.0.7
 spacebars-compiler@1.0.7
 srp@1.0.4
 standard-minifiers@1.0.2
 stylus@2.511.1
 templating@1.1.5
 templating-tools@1.0.0
 tracker@1.0.9
 tsega:bootstrap3-datetimepicker@3.1.3_3
 ui@1.0.8
 underscore@1.0.4
 url@1.0.5
 webapp@1.2.3
 webapp-hashing@1.0.5
 workman:x-editable-reactive-template@1.0.2
 yogiben:autoform-file@0.4.1
diff --git a/app/server/mongo_migrations/migrations.coffee b/app/server/mongo_migrations/migrations.coffee
new file mode 100644
index 0000000..fd1e0eb
--- /dev/null
+++ b/app/server/mongo_migrations/migrations.coffee
@@ -0,0 +1,36 @@
+Migrations.add
+  version: 1
+  up: ->
+    console.log "delete everything except questionnaires & questions"
+    Answers.remove({})
+    Patients.remove({})
+    Studies.remove({})
+    StudyDesigns.remove({})
+    Visits.remove({})
+
+Migrations.add
+  version: 2
+  up: ->
+    console.log "sanitize: choices variables & null values; multiplechoice modes"
+    Questionnaires.find().forEach (questionnaire) ->
+      Questions.find().forEach (question) ->
+        if question.choices?
+          question.choices = question.choices.filter (choice) ->
+            choice?
+          question.choices.forEach (choice) ->
+            choice.variable = choice.value
+          #console.log question.choices
+          Questions.update question._id,
+            $set:
+              choices: question.choices
+        if question.type is 'multipleChoice'
+          if !question.mode?
+            question.mode = 'radio'
+          #console.log question
+          Questions.update question._id,
+            $set:
+              mode: question.mode
+
+Meteor.startup ->
+  #Migrations.migrateTo('1,rerun')
+  Migrations.migrateTo('latest')