added invalid data validation