added validation to lines 59-61