enforce type check on save