Added data validation, error msgs.