added more validation