added validation and a missing table and output