added validation to line 39