add a bit of validation