added validation to button types, etc.