added validation to question and answer